package com.saas.tenant.config;

/**
 * @auther Jiang Tian
 * @date 2025/3/5
 * @apiNote
 **/
public class DataSourceContextHolder {

    private static final ThreadLocal<DataSourceType> contextHolder = new ThreadLocal<>();

    public static void setDataSource(DataSourceType dataSourceType){
        contextHolder.set(dataSourceType);
    }

    public static DataSourceType getDataSource(){
        return contextHolder.get();
    }

    public static void clearDataSource(){
        contextHolder.remove();
    }
}
